#include <stdio.h>
#include <string.h>

#include "sm3.h"

int main(int argc, char* argv[])
{
    const char* msg = "sm3_test";
    unsigned char buff[32] = { 0 };

    sm3((unsigned char*)msg, strlen(msg), buff);
    printf("sm3: ");
    for (int i = 0; i < sizeof(buff); ++i) {
        printf("%X", msg[i]);
    }
    printf("\n");

    const char* key = "sm3_hmac_test_key";
    memset(buff, 0, sizeof(buff));
    sm3_hmac((unsigned char*)msg, strlen(msg), (unsigned char*)key, strlen(key), buff);
    printf("sm3_hmac: ");
    for (int i = 0; i < sizeof(buff); ++i) {
        printf("%X", msg[i]);
    }
    printf("\n");

    return 0;
}